package com.qf.controller.medicineCategory;

import com.qf.entity.MedicineCategoryVo;
import com.qf.service.medicineCategory.MedicineCategoryService;
import com.qf.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * --- 永无霸哥 ---
 *
 * @author M.rk
 * @date 2024/12/5 22:21
 * @desc
 */
@RestController
@RequestMapping("/MedicineCategory")
@Slf4j
public class medicineCategoryController {

    @Autowired
    MedicineCategoryService mcs;

    //商品分类
    @GetMapping("/searchGoodsByCategory")
    public R searchGoodsByCategory(MedicineCategoryVo medicineCategoryVo) {
        List<MedicineCategoryVo> medicineCategoryVos = mcs.searchGoodsByCategory(medicineCategoryVo);

        if (medicineCategoryVos != null) {
            return R.ok(medicineCategoryVos);
        }

        return R.fail();
    }


}
